package com.gmail.liulijuan.Busyness;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.gmail.liulijuan.DB.Employee;
import com.gmail.liulijuan.DB.EmployeeDao;

public class Login {
	public boolean isLogin(String id,String password){
		EmployeeDao ed=new EmployeeDao();
		Employee el;
		el=ed.findByID(Integer.parseInt(id));
		  
		
		if(password.equals(el.getPassword())){
			return true;	
		}else{
			return false;
		}
                                                             
	}
	public Employee getLoginUser(int id,String password){
		EmployeeDao ed=new EmployeeDao();
		Employee el;
		el=ed.findByID(id);
		if(el!=null){
			if(el.getPassword().equals(password)){
				return el;
			}
		}
		return null;
	}

}
